#include "deltatime.hpp"

std::clock_t vx::DeltaTime::_prevClock = 0L;
float vx::DeltaTime::_dt = 0.f;

void vx::DeltaTime::update()
{
    const std::clock_t now = std::clock();
    _dt = float(now - _prevClock) / CLOCKS_PER_SEC;
    _prevClock = now;
}

float vx::DeltaTime::getDt()
{
    return _dt;
}